﻿public partial class Solution
{
    public int ClimbStairs(int n)
    {
        int result = 0;
        switch (n)
        {
            case 1:
                result = 1;
                break;
            case 2:
                result = 2;
                break;
            default:
                List<int> dp = new List<int>(n) { 1, 2 };
                for (int i = 2; i < n; i++)
                {
                    dp.Add(dp[i - 1] + dp[i - 2]);
                }
                result = dp[n - 1];
                break;
        }
        return result;
    }
}
